package com.cloud.core.common;

import lombok.Builder;
import lombok.Data;
import lombok.extern.java.Log;

/**
 * Created by cloudy.xie on 18/2/9.
 */
@Builder
@Data
@Log
public class BaseDto<T>{

    private int code;
    private String msg;
    private T data;

    public static BaseDto ok(){
        return ok(null);
    }


    public static BaseDto ok(Object data){
        return BaseDto.builder().code(CommonError.OK.getCode()).msg(CommonError.OK.getMsg())
                .data(data).build();
    }
}
